package src

import (
	"fmt"
	"sync"
	"time"
)

var (
	tic        *time.Ticker
	tickerOnce sync.Once
)

func TickerStopCheck() {
	tickerOnce.Do(func() {
		tic = time.NewTicker(1 * time.Second)
	})
	defer tic.Stop()
	// tic.Reset(10 * time.Second)
	a := 0
	for range tic.C {
		a++
		if a > 10 {
			fmt.Println("Stop")
			return
		}
		fmt.Println(11111111111111)
	}
}
